package com.qiaofang.applet.service.property.service.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Created by IDEA.
 *
 * @auther Zym.
 * @company qiaofang
 * @date 2020/10/13 19:35
 */
@Data
@NoArgsConstructor
@ApiModel("户型图")
@AllArgsConstructor
public class HouseTypeDto {

    @ApiModelProperty("图片Uuid")
    private String photoUuid;

    @ApiModelProperty("图片链接地址")
    private String photoURL;

    @ApiModelProperty("户型")
    private String houseType;

    @ApiModelProperty(value = "房")
    private Integer countF;
    @ApiModelProperty(value = "厅")
    private Integer countT;
    @ApiModelProperty(value = "卫")
    private Integer countW;

    // TODO: 2020/10/20 同户型面积不一定相同
    @ApiModelProperty("面积/平米")
    private Double fangSquare;

    @ApiModelProperty("在售套数")
    private Integer saleNum;

    @ApiModelProperty("在租套数")
    private Integer rentNum;

    public String getHouseType() {
        StringBuffer sb = new StringBuffer();
        sb.append(getCountF() == null ? "0" : getCountF()).append("室")
                .append((getCountT() == null ? "0" : getCountT()) + "厅")
                .append((getCountW() == null ? "0" : getCountW()) + "卫");

        return sb.toString();
    }
}
